﻿# MySQL-Front 5.0  (Build 1.0)

/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE */;
/*!40101 SET SQL_MODE='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES */;
/*!40103 SET SQL_NOTES='ON' */;


# Host: localhost    Database: cake
# ------------------------------------------------------
# Server version 5.0.67-community-nt

DROP DATABASE IF EXISTS `cake`;
CREATE DATABASE `cake` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `cake`;

#
# Table structure for table cake
#

CREATE TABLE `cake` (
  `id` bigint(20) NOT NULL auto_increment,
  `name` varchar(30) default NULL,
  `price` decimal(10,2) default NULL,
  `remark` varchar(2000) default NULL,
  `picture` varchar(200) default NULL,
  `category` bigint(20) default NULL,
  PRIMARY KEY  (`id`),
  KEY `FK_Reference_1` (`category`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=gbk;
INSERT INTO `cake` VALUES (1,'Mousse',78,'taste good','images/cake/musi.jpg',1);
INSERT INTO `cake` VALUES (2,'Chocolate',99,'taste good','images/cake/qiaokeli.jpg',1);
INSERT INTO `cake` VALUES (3,'Wedding cake',25,'taste good','images/cake/hunli.jpg',1);
INSERT INTO `cake` VALUES (4,'Children’s cake',120,'taste good','images/cake/ertong.jpg',1);
INSERT INTO `cake` VALUES (5,'Baked bread',68,'taste good','images/bread/tianbao.jpg',2);
INSERT INTO `cake` VALUES (6,'Sandwich bread',99,'taste good','images/bread/jiaxian.jpg',2);
INSERT INTO `cake` VALUES (7,'Denmark bread',20,'taste good','images/bread/danmai.jpg',2);
INSERT INTO `cake` VALUES (8,'French long loaf bread',120,'taste good','images/bread/fabang.jpg',2);
INSERT INTO `cake` VALUES (9,'Pudding',58,'taste good','images/xidian/changwen.jpg',3);
INSERT INTO `cake` VALUES (10,'Pie',99,'taste good','images/xidian/pai.jpg',3);
INSERT INTO `cake` VALUES (11,'Rusks',20,'taste good','images/bingan/jianguo.jpg',4);
INSERT INTO `cake` VALUES (12,'Coconut Bar',120,'taste good','images/bingan/hunshu.jpg',4);
INSERT INTO `cake` VALUES (13,'Black Forest Cake',20,'new...','images/new/new1.jpg',5);
INSERT INTO `cake` VALUES (14,'Pudding Cake',34,'new...','images/new/new2.jpg',5);
INSERT INTO `cake` VALUES (15,'Fruit Cake',50,'new...','images/new/new3.jpg',5);
INSERT INTO `cake` VALUES (16,'Lovely Animal Style Cake',32,'new...','images/new/new4.jpg',5);

#
# Table structure for table category
#

CREATE TABLE `category` (
  `id` bigint(20) NOT NULL auto_increment,
  `name` varchar(30) default NULL,
  `remark` varchar(2000) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=gbk;
INSERT INTO `category` VALUES (1,'cake',NULL);
INSERT INTO `category` VALUES (2,'bread',NULL);
INSERT INTO `category` VALUES (3,'cookies',NULL);
INSERT INTO `category` VALUES (4,'sweet',NULL);
INSERT INTO `category` VALUES (5,'new products',NULL);

#
# Table structure for table comment
#

CREATE TABLE `comment` (
  `Id` bigint(20) NOT NULL auto_increment,
  `userid` bigint(20) NOT NULL default '0',
  `orderid` bigint(20) NOT NULL default '0',
  `type` int(1) NOT NULL default '0',
  `content` varchar(2000) default NULL,
  `occurTime` varchar(20) default NULL,
  PRIMARY KEY  (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Table structure for table diy
#

CREATE TABLE `diy` (
  `id` bigint(20) NOT NULL auto_increment,
  `userid` bigint(20) default NULL,
  `phone` varchar(11) default NULL,
  `amount` decimal(10,2) default NULL,
  `code` varchar(22) default NULL,
  `status` int(11) default NULL,
  `address` varchar(200) default NULL,
  `quantity` int(11) default NULL,
  `remark` varchar(500) default NULL,
  `description` varchar(1000) default NULL,
  `picture` varchar(100) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=gbk;
INSERT INTO `diy` VALUES (1,2,'123456',435,'20120312101311875',3,'zhongguo',1,'null','Suitable for: birthday (old);Taste: chocolate;Size: 20inch;Layer: layer3;knife2: 2;fork2: 1;dish3: 5; ','images/require/20120312101311875.jpg');

#
# Table structure for table manager
#

CREATE TABLE `manager` (
  `id` bigint(20) NOT NULL auto_increment,
  `username` varchar(30) default NULL,
  `password` varchar(20) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=gbk;
INSERT INTO `manager` VALUES (1,'admin','123456');

#
# Table structure for table message
#

CREATE TABLE `message` (
  `Id` bigint(20) NOT NULL auto_increment,
  `userid` bigint(20) NOT NULL default '0',
  `content` varchar(2000) default NULL,
  `occurTime` varchar(20) default NULL,
  PRIMARY KEY  (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Table structure for table myorder
#

CREATE TABLE `myorder` (
  `id` bigint(20) NOT NULL auto_increment,
  `code` varchar(22) default NULL,
  `amount` decimal(10,2) default NULL,
  `status` int(11) default NULL,
  `userid` bigint(20) default NULL,
  `address` varchar(200) default NULL,
  `phone` varchar(11) default NULL,
  `remark` varchar(500) default NULL,
  PRIMARY KEY  (`id`),
  KEY `FK_Reference_2` (`userid`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=gbk;
INSERT INTO `myorder` VALUES (6,'20111205015537588',1480,2,1,'chongqing','13996373835','please quick');
INSERT INTO `myorder` VALUES (7,'20111205030724838',99,2,1,'hhh','13996383547','4567');
INSERT INTO `myorder` VALUES (8,'20111205030756463',400,3,1,'guangdong','13996373589','fast22');
INSERT INTO `myorder` VALUES (9,'2011120503082425',600,3,1,'jiangxi','13969874578','dsaggd');
INSERT INTO `myorder` VALUES (10,'20111206094456687',360,2,1,'fujian','13569787415','');
INSERT INTO `myorder` VALUES (11,'2011120609510062',297,2,2,'beijing','13996383578','');
INSERT INTO `myorder` VALUES (12,'20111206095204281',360,2,3,'zhejiang','15925897894','');
INSERT INTO `myorder` VALUES (15,'2011121602441515',600,1,1,'jiangshu','15968487895','');
INSERT INTO `myorder` VALUES (16,'20120328033732515',156,3,2,'gfgededd','13678900987','');

#
# Table structure for table orderdetail
#

CREATE TABLE `orderdetail` (
  `id` bigint(20) NOT NULL auto_increment,
  `orderid` bigint(20) default NULL,
  `cakeid` bigint(20) default NULL,
  `quantity` int(11) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=gbk;
INSERT INTO `orderdetail` VALUES (1,6,1,10);
INSERT INTO `orderdetail` VALUES (2,7,2,1);
INSERT INTO `orderdetail` VALUES (3,8,3,2);
INSERT INTO `orderdetail` VALUES (4,9,3,3);
INSERT INTO `orderdetail` VALUES (5,10,8,3);
INSERT INTO `orderdetail` VALUES (6,11,10,3);
INSERT INTO `orderdetail` VALUES (7,12,12,3);
INSERT INTO `orderdetail` VALUES (9,15,3,3);
INSERT INTO `orderdetail` VALUES (10,16,1,2);

#
# Table structure for table shoppingcart
#

CREATE TABLE `shoppingcart` (
  `id` bigint(20) NOT NULL auto_increment,
  `cakeid` bigint(20) default NULL,
  `quantity` int(11) default NULL,
  `userid` bigint(20) default NULL,
  `remark` varchar(500) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=gbk;
INSERT INTO `shoppingcart` VALUES (11,2,3,3,'null');
INSERT INTO `shoppingcart` VALUES (12,13,4,1,'null');
INSERT INTO `shoppingcart` VALUES (15,16,1,2,'null');
INSERT INTO `shoppingcart` VALUES (16,15,1,2,'null');

#
# Table structure for table user
#

CREATE TABLE `user` (
  `id` bigint(20) NOT NULL auto_increment,
  `username` varchar(30) default NULL,
  `password` varchar(20) default NULL,
  `idcard` varchar(18) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=gbk;
INSERT INTO `user` VALUES (1,'customer','123456','360835198805242115');
INSERT INTO `user` VALUES (2,'cyxl','123456','360835198805262546');
INSERT INTO `user` VALUES (3,'user','123456','360879198705021598');
INSERT INTO `user` VALUES (4,'aha','123','aha@gmail.com');
INSERT INTO `user` VALUES (5,'aha2','123','aha@gmail.com');
INSERT INTO `user` VALUES (6,'mine','123','123@123.COM');
INSERT INTO `user` VALUES (7,'hihi','123','hihi@126.com');
INSERT INTO `user` VALUES (8,'hjhj','123','hjhj@12.com');

#
#  Foreign keys for table cake
#

ALTER TABLE `cake`
ADD CONSTRAINT `FK_Reference_1` FOREIGN KEY (`category`) REFERENCES `category` (`id`);

#
#  Foreign keys for table myorder
#

ALTER TABLE `myorder`
ADD CONSTRAINT `FK_Reference_2` FOREIGN KEY (`userid`) REFERENCES `user` (`id`);


/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
